package com.autoMobile.servlet.rrm;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.autoMobile.bean.rrmSgjl;
import com.autoMobile.dao.rrmbxDao;


@WebServlet("/sgjlServlet")
public class sgjlServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

    public sgjlServlet() {

    }


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		//接收用户请求参数
		
		//调用dao层 操作数据库

		rrmbxDao dao =new rrmbxDao();
		List<rrmSgjl> list=dao.listSgjl();
		System.out.println("List size: " + (list == null ? "null" : list.size()));
		request.setAttribute("list", list);
		System.out.println(list.toString());
		//控制转向
		request.getRequestDispatcher("admin/accident-records.jsp").forward(request, response);
		
	}

}
